home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / disk / cdrom / SkandalfoCDP.lha / SCDPlayer / Rexx / PrintCDCover.scdp < prev    next >
Text File  |  1996-08-16  |  1KB  |  76 lines

  1. /* SCDP Script for printing CD covers */
  2. /* It's only an example, not very much useful. */
  3.  
  4. OPTIONS RESULTS
  5.  
  6. ESC=D2C(27)
  7. BOLD=ESC"[1m"ESC'[4"z'
  8. UNBOLD=ESC"[22m"ESC'[3"z'
  9. PICA=ESC"[0w"
  10. ENLARGEDON=ESC"[6w"
  11. ENLARGEDOFF=ESC"[5w"
  12. INIT=ESC"#1"ESC"[0z"
  13.  
  14. STATUS
  15. IF RESULT=NODISK THEN RETURN
  16.  
  17. IF OPEN(PRINTER,"PRT:","W") THEN DO
  18.     CDARTIST
  19.     ART=RESULT
  20.     
  21.     CDTITLE
  22.     TIT=RESULT
  23.     
  24.     TRACKS
  25.     NUM=RESULT
  26.     
  27.     DO WHILE LENGTH(ART)<22
  28.         ART=" "ART" "
  29.         END
  30.         
  31.     DO WHILE LENGTH(TIT)<22
  32.         TIT=" "TIT" "
  33.         END
  34.         
  35.     CALL WRITELN(PRINTER,INIT||PICA||ENLARGEDON||ART)
  36.     CALL WRITELN(PRINTER,BOLD||TIT||UNBOLD||ENLARGEDOFF)
  37.     
  38.     CALL WRITELN(PRINTER,"")
  39.     
  40.     DO I=1 TO NUM
  41.         TRACKNAME I
  42.         NAM=RESULT
  43.         
  44.         TRACKSTART I
  45.         A=RESULT
  46.         
  47.         TRACKEND I
  48.         B=RESULT
  49.         
  50.         IF I<10 THEN
  51.             NU=" "I
  52.         ELSE
  53.             NU=I
  54.             
  55.         DUR=(B-A)%75
  56.         
  57.         MIN=DUR%60
  58.         SEC=DUR-MIN*60
  59.         
  60.         IF LENGTH(SEC)<2 THEN SEC="0"SEC
  61.         IF LENGTH(MIN)<2 THEN MIN=" "MIN
  62.         
  63.         TIM=" "MIN":"SEC
  64.         
  65.         CAD=NU NAM||" "
  66.         
  67.         DO WHILE LENGTH(CAD)<41
  68.             CAD=CAD"."
  69.             END
  70.         
  71.         CALL WRITELN(PRINTER,CAD||TIM)
  72.         
  73.         END
  74.         
  75.         CALL CLOSE(PRINTER)
  76.     END